package com.team11.server.service.admin;

import com.team11.server.mapper.Admin_Insert_P_Mapper;
import com.team11.server.pojo.PInformation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class Admin_Insert_P_Service {
    @Autowired
    private Admin_Insert_P_Mapper admin_insert_p_mapper;

    public Integer SelTid(String tJobNumber){
        return admin_insert_p_mapper.SelTid(tJobNumber);
    }
    public String insert_p(PInformation pInformation){
        Integer t=admin_insert_p_mapper.InsertP(pInformation);
        if (t>0){
            return "新增成功";
        }
        else return "新增失败";
    }

    public String SelHaveP(String pName){
        Integer t=admin_insert_p_mapper.SelHaveP(pName);
        if (t>0){
            return "组名已存在";
        }
        else return "1";
    }
    public String SelHavePs(String pName){
        Integer t=admin_insert_p_mapper.SelHaveP(pName);
        if (t>1){
            return "组名已存在";
        }
        else return "1";
    }
}
